<template>
  <div id='tousu'>
    <h1 style="text-align: center;">问卷调查</h1>

    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="您对安徽省国家税务总局大厅是否满意" prop="satisfaction">
        <div style="margin-top: 20px">
          <el-radio-group v-model="form.satisfaction" size="medium">
            <el-radio-button label="很满意"></el-radio-button>
            <el-radio-button label="比较满意"></el-radio-button>
            <el-radio-button label="不满意"></el-radio-button>
          </el-radio-group>
        </div>
      </el-form-item>
      <el-form-item label="您对工作人员业务能力和服务态度评价" prop="serve_capacity">
        <div style="margin-top: 20px">
          <el-radio-group v-model="form.serve_capacity" size="medium">
            <el-radio-button label="很满意,热情周到,办事顺利"></el-radio-button>
            <el-radio-button label="服务态度很好,就是办事难"></el-radio-button>
            <el-radio-button label="不满意,态度生硬"></el-radio-button>
          </el-radio-group>
        </div>
      </el-form-item>

      <el-form-item label="您在服务大厅办事等候最长时间是" prop="serve_await">
        <div style="margin-top: 20px">
          <el-radio-group v-model="form.serve_await" size="medium">
            <el-radio-button label="30分钟以内"></el-radio-button>
            <el-radio-button label="1小时以内"></el-radio-button>
            <el-radio-button label="一上午或者一下午办不成"></el-radio-button>
          </el-radio-group>
        </div>
      </el-form-item>

      <el-form-item label="您如何评价服务大厅的办事效率" prop="efficiency">
        <div style="margin-top: 20px">
          <el-radio-group v-model="form.efficiency" size="medium">
            <el-radio-button label="效率高"></el-radio-button>
            <el-radio-button label="效率一般"></el-radio-button>
            <el-radio-button label="效率较低"></el-radio-button>
            <el-radio-button label="效率差"></el-radio-button>
          </el-radio-group>
        </div>
      </el-form-item>

      <el-form-item label="请给出您的建议" prop="suggest">
        <el-input type="textarea" v-model="form.suggest" :min-height="192" />
      </el-form-item>

      <el-button type="primary" @click="submitForm">提交</el-button>
      <el-button @click="cancel">重置</el-button>
    </el-form>

  </div>
</template>


<script>
//！！！！1.引入2.注册.3使用
//例如：import 《组件名称》 from '《组件路径》';
import { addServe } from '@/api/serve/serve'

export default {
  name: 'tousu-vue',
  //这里注册
  components: {},
  dicts: ['c_type'],
  data() {
    //这里存放数据
    return {
      form: {
        satisfaction: '很满意',
        serve_capacity: '很满意,热情周到,办事顺利',
        serve_await: '30分钟以内',
        efficiency: '效率高',
        suggest: ''
      }
    }
  },
  //计算属性 类似于data概念
  computed: {},
  methods: {
    /** 新增按钮操作 */
    submitForm() {
      this.$refs['form'].validate((valid) => {
        addServe(this.form).then((response) => {
          console.log(this.form)
          this.$modal.msgSuccess('新增成功')
          // this.open = false
          // this.getList()
        })
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        satisfaction: null,
        serve_capacity: null,
        serve_await: null,
        efficiency: null,
        suggest: null
      }
    }
  },

  //生命周期 - 创建完成（可以访问当前this实例身上的data和methods）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {}
}
</script>
<style></style>
